package com.audiocn.Utils;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;

/**
 * 这里记录调试日志
 * 
 * @author 白璐
 */
public class Log {
	public static boolean isDebug = false;

	public static void e(String t, String c) {
		if (isDebug && c != null) {
			android.util.Log.e(t, c);
		}
	}

	public static void logToFile(String info) {
		try {
			String aLogFile = Utils.getSdcardPath()+"/TL_LI.log";
			File iFile = new File(aLogFile);
			if (!iFile.exists()) {
				iFile.createNewFile();
			}
			FileWriter aFileStream = new FileWriter(iFile, true);
			BufferedWriter aWriter = new BufferedWriter(aFileStream);
			aWriter.write("["+Utils.returnNowTime()+"]"+info);
			aWriter.write("\r\n");
			aWriter.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
